import unittest
from selenium import webdriver
from data032.Page.Page import Page
from data032.Page.Page1 import Page1
from selenium.webdriver.common.keys import Keys
from ddt import ddt,file_data
import logging
import yagmail


@ddt
class Case(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Edge()
    def tearDown(self):
        self.driver.quit()
    @file_data('a3mall.yaml')
    def test_A3mall_001(self,username,password):
        po = Page(self.driver)
        po.test_a3mall_case_01(username,password)
        po1 = Page1(self.driver)
        po1.test_a3mall_case_02()
    def youjian(self):
        logging.basicConfig(level=logging.DEBUG,filename='a3mall.log',filemode='w+',format='%(levelname)s %(funcName)s %(message)s %(lineno)d')
        youjian = yagmail.SMTP(user='3151075207@qq.com',password='mrqrvidbupdcddgd',host='www.smtp.com')
        youjian.send(to='3151075207@qq.com',subject='a3mall系统Web Ui自动化测试报告',contents='a3mall系统Web Ui自动化测试报告',attachments='a3mall.log')
if __name__ == '__main__':
    unittest.main()
